const express = require('express'); //1
const server = express(); //2
const fs = require("fs");

server.get('/',(req,res) => { 
    let data = fs.readFileSync('./index.html');
    res.set('Content-Type','text/html;charset=utf-8');
    res.end(data.toString());
});

server.get('/script.js',(req,res) => { 
    let data = fs.readFileSync('./script.js');
    res.set('Content-Type','application/javascript');
    setTimeout(()=>{
        res.end(data.toString());
    },3000)
});

server.get('/index.css',(req,res) => { 
    let data = fs.readFileSync('./index.css');
    res.set('Content-Type','text/css');
    setTimeout(()=>{
        res.end(data.toString());
    },3000)
});

server.listen(3000); 